﻿using JESAI.Application.Abstractions.Dtos;
using JESAI.Application.Abstractions.Sys;
using JESAI.Application.Abstractions.Sys.Querys;
using JESAI.Application.Service.Sys;
using JESAI.AutoMapper.ObjectMapping;
using JESAI.Framework.Filters;
using JESAI.Platform.WebApi.Vos.Sys;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace JESAI.Platform.WebApi.Controllers.Sys
{
    [ApiController]
    [Route("api/v1/[controller]")]
    [Authorize("permission")]
    [IgnoreResultHandlerAttribute]
    public class OnlineController : ControllerBase
    {
        private readonly IOnlineService _onlineService;
        public OnlineController(IOnlineService onlineService)
        {
            _onlineService = onlineService;
        }

        [HttpGet("GetPageList")]
        public async Task<BasePageOutput<List<OnlineInfoResponse>>> GetPageList([FromQuery] OnlineInfoPageQuery onlineInfoPageQuery)
        {
            var formPageList = await _onlineService.GetPageList(onlineInfoPageQuery);
            return formPageList.MapTo<BasePageOutput<List<OnlineInfoResponse>>>();
        }
    }
}
